<?php include $this->admin_tpl('meta');?>
<title>模块列表 - YzmCMS内容管理系统</title>
</head>
<body>
<nav class="breadcrumb"><i class="yzm-iconfont yzm-iconai-home"></i> 首页 <span class="c-gray en">&gt;</span> 模块管理 <span class="c-gray en">&gt;</span> 模块列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="yzm-iconfont yzm-iconshuaxin"></i></a></nav>
<div class="page-container">
  <form method="post" action="<?php echo U('user_config_del');?>" id="myform">
  <table class="table table-border table-bg table-hover table-sort">
    <thead>
      <tr class="text-c">
		<th>模块名称</th>
        <th>模块目录</th>
        <th>版本号</th>
        <th>安装日期</th>
        <th>更新日期</th>
        <th width="85">管理操作</th>
      </tr>
    </thead>
    <tbody>
		<?php 
		foreach($directory as $d){
			if (array_key_exists($d, $modules)) {
		?>
		  <tr class="text-c">
			<td><?php echo $modules[$d]['name']?></td>
			<td><?php echo $d?></td>
			<td><?php echo $modules[$d]['version']?></td>
			<td><?php echo $modules[$d]['installdate']?></td>
			<td><?php echo $modules[$d]['updatedate']?></td>
			<td><?php if ($modules[$d]['iscore']) {?><span class="yzm-box-img btn-disabled">禁止</span><?php } else {?><span><a href="javascript:void(0);" onclick="yzm_confirm('<?php echo U('uninstall',array('module'=>$d));?>', '确定要卸载【<?php echo $modules[$d]['name']?>】模块吗？',1)" class="yzm-box-img btn-danger">卸载</a></span><?php }?></td>
		  </tr>		
		<?php 
			}else{
				if(is_file(APP_PATH.$d.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'config.inc.php')) {
					$isinstall = true;
					$arr = include(APP_PATH.$d.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'config.inc.php');
					$arr = is_array($arr) ? $arr : array();
				}else{
					$isinstall = false;
					$arr = array();
				}
			?>
		  <tr class="text-c">
			<td><?php echo isset($arr['name']) ? htmlspecialchars($arr['name']) : '未知';?></td>
			<td><?php echo $d?></td>
			<td><?php echo isset($arr['version']) ? htmlspecialchars($arr['version']) : '未知';?></td>
			<td>未安装</td>
			<td><?php echo isset($arr['updatedate']) ? htmlspecialchars($arr['updatedate']) : '未知';?></td>
			<td><?php if($isinstall){?> <span><a href="javascript:void(0);" onclick="yzm_open('模块安装','<?php echo U('install',array('module'=>$d));?>','550','350')" class="yzm-box-img btn-primary">安装</a></span><?php } else {?><span class="yzm-box-img btn-warning">无法安装</span><?php }?></a></td>
		  </tr>	
		<?php
			}
		}
		?>
    </tbody>
  </table>
  </form>
  <div id="page"><span class="page_left">共<?php echo $total?>条记录，共<?php echo $page->total()?>页，当前显示第<?php echo $page->getpage()?>页</span>
  <span class="page_right"><?php echo $page->getfull();?></span></div>
</div>
<?php include $this->admin_tpl('footer');?>

</body>
</html>